<?php  
    if($_POST["userName"] !=null || $_POST["userName"] != ""){
        session_start();
        $_SESSION['userName']=$_POST["userName"];
        $_SESSION['pwd']=$_POST["pwd"];
        include("../conf/mysqlconn.php");
        $dbconf = new MysqlConnector();
        $con = $dbconf->connectMySql();
        if (!$con) {
            die('连接数据库失败:' . mysql_error());
        }
        $userID=$_SESSION['userName'];
        $pwd=$_SESSION['pwd'];
        mysql_query("insert into User (UserID,PassWord,UStatus,RoleCode,UpdateTime) 
            values('$userID','$pwd','0','0',sysdate());");
        mysql_close($con);
        header("Location: myAccount.php"); 
        exit;
     }
?>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
        <script src="../js/account.js"></script>
    </head>
    <body>
        <form action="register.php" method="post">
            <div>
                <label>用户注册</label>
                <div>
                    <label>用户名：</label>
                    <input type="text" value="" name="userName" id="userName" onkeyup="showHint(this.value)" onblur="checkEmpty(this.value);" />
                    <span id="txtHint"></span><input type="hidden" value="" id="validFlag" />
                </div>
                <div>
                    <label>密码：</label><input type="password" value="" name="pwd" id="pwd" />
                </div>
                <input type="button" value="注册" id="btn" onclick="doSubmit(this.form);" />
            </div>
        </form>
        
    </body>
</html>
